package com.daxia.bumall.config;

import javax.annotation.PostConstruct;

import org.springframework.stereotype.Component;

import com.daxia.bumall.util.DevUtils;

import payment.api.system.PaymentEnvironment;

@Component
public class PayInit {

	public static String zj_orgNo = "002273";
	public static String zj_notifyUrl = "http://120.55.190.175:8080/pay/notificationZJ";
	
	@PostConstruct
	public void init() {
		/// String paymentConfigPath = systemConfigService.get(SystemConfigType.ZjPay_config_path);
        //DOMConfigurator.configure(log4jConfigFile);
        // 初始化支付环境
		try {
			// 改在本地的路径
			if (DevUtils.isProductServer()) {
				PaymentEnvironment.initialize("/data/bumall/src/main/resources/pay/config/productpayment");
			} else if (DevUtils.isTestServer()) {
				PaymentEnvironment.initialize("/home/guoqiang/code/bumall/trunk/bumall/src/main/resources/pay/config/testpayment");
			} else if (DevUtils.isLocal()) {
				PaymentEnvironment.initialize("/Users/kevin/Documents/code/bumall/trunk/bumall/src/main/resources/pay/config/testpayment");
			} else {
				PaymentEnvironment.initialize("/Users/kevin/Documents/code/bumall/trunk/bumall/src/main/resources/pay/config/testpayment");
			}
		} catch (Exception e) {
			//e.printStackTrace();
		}
	}
}
